package top.healthylife.gateway.platform.td.dto.util;

import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import top.healthylife.gateway.platform.td.dto.creditbodyguard.precreditauditscore.res.TdResPreCreditAuditScoreDto;


/**
 * @author : GaoZeXi
 * @date 2021/7/22 11:28
 */

public class BuildDtoUtil {

   static String str = "value\t节点值\tString\t\n" +
           "link_associations_key\t团伙详情编号\tString\t用于查看团伙详情\n" +
           "node_score\t关联风险分\tInteger\t范围0~100。100分制，为进件数据逾期风险量化分值，可作为复杂网络实时风险群体的决策指标，该欺诈分为群体欺诈分和节点欺诈分综合得出。\n" +
           "degree\t节点度\tInteger\t一度关联节点数\n" +
           "group_id\t风险群体id\tString\t\n" +
           "total_cnt\t风险群体的节点个数\tInteger\t\n" +
           "black_cnt\t风险名单个数\tInteger\t\n" +
           "grey_cnt\t关注名单个数\tInteger\t\n" +
           "node_dist\t风险群体的节点分布(占比)\tString\t多个类型以分号分隔，已经过解析的，如：手机号码:20(66.67%);身份证:10(33.33%)\n" +
           "fraud_dist\t风险名单类型分布(占比)\tString\t多个类型以分号分隔，已经过解析的，如：电信欺诈:20(66.67%);法院执行:10(33.33%)\n" +
           "fraud_dist_one\t一度关联风险名单类型分布\tString\t多个类型以分号分隔，以英文表示，如：电信欺诈:20(66.67%);法院执行:10(33.33%)\n" +
           "black_cnt_one\t一度关联风险名单个数\tInteger\t\n" +
           "total_cnt_two\t二度关联节点个数\tInteger\t\n" +
           "black_cnt_two\t二度关联风险名单个数\tInteger\t\n" +
           "fraud_dist_two\t二度关联风险名单类型分布\tString\t多个类型以分号分隔，以英文表示，如：电信欺诈:20(66.67%);法院执行:10(33.33%)\n" +
           "black_dst\t与黑名单距离\tInteger\t\n" +
           "core_dst\t与核心节点的距离\tInteger\t\n" +
           "core_node\t是否核心节点\tBoolean\t\n" +
           "black_rat\t风险名单占比\tString\t\n" +
           "grey_rat\t关注名单占比\tString\t";

    static String template1 = "" +
//            "package com.hare.service.td.dto.creditbodyguard;" +
//            "@DetailData" +
//            "@Accessors(chain = true)" +
//            "@ApiModel(\"{beanName}\")" +
//            "public class {className} " +
            "@ApiModelProperty(value = \"{}\",example = \"{}\" , notes = \"{}\" )\n" +
            "private {} {};\n";

    public static void main(String[] args) {
//     print();
     serialization();
    }


    public static void serialization(){
     JSONObject jsonObject = JSONObject.parseObject(json);
     JSONObject jsonObject1 = jsonObject.getJSONObject("result_desc").getJSONObject("ANTIFRAUD");
     TdResPreCreditAuditScoreDto tdResPreCreditAuditScoreDto = JSONObject.toJavaObject(jsonObject1,TdResPreCreditAuditScoreDto.class);
     System.out.println("jsonObject = " + jsonObject);
    }


    static String json = "{\n" +
            "    \"success\": true,\n" +
            "    \"id\": \"WF2017102621040019796391\",\n" +
            "    \"result_desc\": {\n" +
            "        \"ANTIFRAUD\": {\n" +
            "            \"output_fields\": {\n" +
            "                \"antifraud_decision\": \"Reject\",\n" +
            "                \"antifraud_model_score\": 80\n" +
            "            },\n" +
            "            \"final_score\": 611,\n" +
            "            \"risk_items\": [\n" +
            "                {\n" +
            "                    \"rule_id\": 714622,\n" +
            "                    \"score\": 10,\n" +
            "                    \"risk_name\": \"身份证归属地位于高风险较为集中地区\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"description\": \"是否命中自定义名单\",\n" +
            "                            \"type\": \"custom_list\",\n" +
            "                            \"high_risk_areas\": [\n" +
            "                                \"浙江省杭州市\"\n" +
            "                            ]\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 714650,\n" +
            "                    \"score\": 80,\n" +
            "                    \"risk_name\": \"身份证命中法院失信名单\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"hit_type_display_name\": \"身份证号码\",\n" +
            "                            \"fraud_type_display_name\": \"\",\n" +
            "                            \"description\": \"身份证命中法院失信名单\",\n" +
            "                            \"court_details\": [],\n" +
            "                            \"type\": \"black_list\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 714686,\n" +
            "                    \"score\": 80,\n" +
            "                    \"risk_name\": \"身份证命中法院执行名单\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"hit_type_display_name\": \"身份证号码\",\n" +
            "                            \"fraud_type_display_name\": \"\",\n" +
            "                            \"description\": \"身份证命中法院执行名单\",\n" +
            "                            \"court_details\": [],\n" +
            "                            \"type\": \"black_list\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 714696,\n" +
            "                    \"score\": 105,\n" +
            "                    \"risk_name\": \"身份证命中信贷逾期名单\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"description\": \"身份证命中信贷逾期名单\",\n" +
            "                            \"discredit_times\": 6,\n" +
            "                            \"overdue_details\": [\n" +
            "                                {\n" +
            "                                    \"overdue_time\": \"2016-07\",\n" +
            "                                    \"overdue_amount_range\": \"(10000, 50000]\",\n" +
            "                                    \"overdue_day_range\": \"(60, 90]\",\n" +
            "                                    \"overdue_count\": 3\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"overdue_time\": \"2016-07\",\n" +
            "                                    \"overdue_amount_range\": \"(10000, 50000]\",\n" +
            "                                    \"overdue_day_range\": \"(60, 90]\",\n" +
            "                                    \"overdue_count\": 7\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"overdue_time\": \"2016-07\",\n" +
            "                                    \"overdue_amount_range\": \"(1000, 5000]\",\n" +
            "                                    \"overdue_day_range\": \"360+\",\n" +
            "                                    \"overdue_count\": 2\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"overdue_time\": \"2016-07\",\n" +
            "                                    \"overdue_amount_range\": \"(100000, 500000]\",\n" +
            "                                    \"overdue_day_range\": \"(270, 360]\",\n" +
            "                                    \"overdue_count\": 1\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"overdue_time\": \"2016-07\",\n" +
            "                                    \"overdue_amount_range\": \"(10000, 50000]\",\n" +
            "                                    \"overdue_day_range\": \"(180, 270]\",\n" +
            "                                    \"overdue_count\": 5\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"overdue_time\": \"2016-07\",\n" +
            "                                    \"overdue_day_range\": \"(60, 90]\",\n" +
            "                                    \"overdue_count\": 4\n" +
            "                                }\n" +
            "                            ],\n" +
            "                            \"type\": \"discredit_count\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 714702,\n" +
            "                    \"score\": 40,\n" +
            "                    \"risk_name\": \"身份证命中高风险关注名单\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"hit_type_display_name\": \"身份证号码\",\n" +
            "                            \"fraud_type_display_name\": \"\",\n" +
            "                            \"grey_list_details\": [],\n" +
            "                            \"description\": \"身份证命中高风险关注名单\",\n" +
            "                            \"type\": \"grey_list\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 714736,\n" +
            "                    \"score\": 40,\n" +
            "                    \"risk_name\": \"身份证命中法院结案名单\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"hit_type_display_name\": \"身份证号码\",\n" +
            "                            \"fraud_type_display_name\": \"\",\n" +
            "                            \"description\": \"身份证命中法院结案名单\",\n" +
            "                            \"court_details\": [],\n" +
            "                            \"type\": \"black_list\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 714750,\n" +
            "                    \"score\": 40,\n" +
            "                    \"risk_name\": \"身份证_姓名命中信贷逾期模糊名单\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"fuzzy_list_details\": [],\n" +
            "                            \"fraud_type_display_name\": \"\",\n" +
            "                            \"description\": \"身份证_姓名命中信贷逾期模糊名单\",\n" +
            "                            \"type\": \"fuzzy_black_list\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 714784,\n" +
            "                    \"score\": 27,\n" +
            "                    \"risk_name\": \"3个月内身份证关联多个申请信息\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"frequency_detail_list\": [\n" +
            "                                {\n" +
            "                                    \"data\": [],\n" +
            "                                    \"detail\": \"3个月身份证关联邮箱数：3\",\n" +
            "                                    \"dim_type\": \"idNumber\",\n" +
            "                                    \"sub_dim_type\": \"accountEmail\",\n" +
            "                                    \"note\": \"3个月身份证关联邮箱数\",\n" +
            "                                    \"count\": \"3\"\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"data\": [],\n" +
            "                                    \"detail\": \"3个月身份证关联手机号数：3\",\n" +
            "                                    \"dim_type\": \"idNumber\",\n" +
            "                                    \"count\": \"3\",\n" +
            "                                    \"sub_dim_type\": \"accountMobile\",\n" +
            "                                    \"note\" : \"3个月身份证关联手机号数\"\n" +
            "                                }\n" +
            "                            ],\n" +
            "                            \"type\": \"frequency_detail\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 714786,\n" +
            "                    \"score\": 12,\n" +
            "                    \"risk_name\": \"3个月内申请信息关联多个身份证\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"frequency_detail_list\": [\n" +
            "                                {\n" +
            "                                    \"data\": [],\n" +
            "                                    \"detail\": \"3个月手机号关联身份证数：3\",\n" +
            "                                    \"dim_type\": \"accountMobile\",\n" +
            "                                    \"sub_dim_type\": \"idNumber\",\n" +
            "                                    \"note\": \"3个月身份证关联身份证数\",\n" +
            "                                    \"count\": \"3\"\n" +
            "                                }\n" +
            "                            ],\n" +
            "                            \"type\": \"frequency_detail\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 714792,\n" +
            "                    \"score\": 10,\n" +
            "                    \"risk_name\": \"3个月内申请人手机号作为联系人手机号出现的次数大于等于2\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"cross_frequency_detail_list\": [\n" +
            "                                {\n" +
            "                                    \"detail\": \"3个月内申请人手机号作为第一联系人手机号出现的次数：44\",\n" +
            "                                    \"dim_type\": \"idNumber\",\n" +
            "                                    \"sub_dim_type\": \"accountMobile\",\n" +
            "                                    \"note\": \"3个月内申请人手机号作为第一联系人手机号出现的次数\",\n" +
            "                                    \"count\": \"44\"\n" +
            "                                }\n" +
            "                            ],\n" +
            "                            \"type\": \"cross_frequency_detail\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 714804,\n" +
            "                    \"score\": 5,\n" +
            "                    \"risk_name\": \"7天内设备或身份证或手机号申请次数过多\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                          \"frequency_detail_list\": [\n" +
            "                            {\n" +
            "                              \"note\": \"3个月手机号关联身份证数\",\n" +
            "                              \"data\": [],\n" +
            "                              \"dim_type\": \"accountMobile\",\n" +
            "                              \"count\": \"6\",\n" +
            "                              \"sub_dim_type\": \"idNumber\",\n" +
            "                              \"detail\": \"3个月手机号关联身份证数：6\"\n" +
            "                            },\n" +
            "                            {\n" +
            "                              \"note\": \"3个月邮箱关联身份证数\",\n" +
            "                              \"data\": [],\n" +
            "                              \"dim_type\": \"accountEmail\",\n" +
            "                              \"count\": \"6\",\n" +
            "                              \"sub_dim_type\": \"idNumber\",\n" +
            "                              \"detail\": \"3个月邮箱关联身份证数：6\"\n" +
            "                            }\n" +
            "                          ],\n" +
            "                          \"type\": \"frequency_detail\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 1118030,\n" +
            "                    \"score\": 40,\n" +
            "                    \"risk_name\": \"3个月内申请人在多个平台申请借款\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"platform_detail_dimension\": [\n" +
            "                                {\n" +
            "                                    \"count\": 1,\n" +
            "                                    \"detail\": [\n" +
            "                                        {\n" +
            "                                            \"count\": 1,\n" +
            "                                            \"industry_display_name\": \"信用卡中心\"\n" +
            "                                        }\n" +
            "                                    ],\n" +
            "                                    \"dimension\": \"手机\"\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"count\": 7,\n" +
            "                                    \"detail\": [\n" +
            "                                        {\n" +
            "                                            \"count\": 5,\n" +
            "                                            \"industry_display_name\": \"无行业\"\n" +
            "                                        },\n" +
            "                                        {\n" +
            "                                            \"count\": 1,\n" +
            "                                            \"industry_display_name\": \"信用卡中心\"\n" +
            "                                        },\n" +
            "                                        {\n" +
            "                                            \"count\": 1,\n" +
            "                                            \"industry_display_name\": \"财产险\"\n" +
            "                                        }\n" +
            "                                    ],\n" +
            "                                    \"dimension\": \"身份证号码\"\n" +
            "                                }\n" +
            "                            ],\n" +
            "                            \"platform_detail\": [\n" +
            "                                {\n" +
            "                                    \"count\": 5,\n" +
            "                                    \"industry_display_name\": \"无行业\"\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"count\": 1,\n" +
            "                                    \"industry_display_name\": \"信用卡中心\"\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"count\": 1,\n" +
            "                                    \"industry_display_name\": \"财产险\"\n" +
            "                                }\n" +
            "                            ],\n" +
            "                            \"description\": \"在指定时间内，主属性匹配字段下关联的合作方的个数\",\n" +
            "                            \"type\": \"platform_detail\",\n" +
            "                            \"platform_count\": 7\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 1118486,\n" +
            "                    \"score\": 1,\n" +
            "                    \"risk_name\": \"跨事件字段比较\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"cross_event_detail_list\": [\n" +
            "                                {\n" +
            "                                    \"detail\": \"主属性不变，统计过去时间片内指定字段值与当前字段值相同的次数：2\",\n" +
            "                                    \"dim_type\": \"idNumber\",\n" +
            "                                    \"sub_dim_type\": \"accountMobile\",\n" +
            "                                    \"note\": \"主属性不变，统计过去时间片内指定字段值与当前字段值相同的次数\",\n" +
            "                                    \"count\": \"2\"\n" +
            "                                }\n" +
            "                            ],\n" +
            "                            \"type\": \"cross_event_detail\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 1118032,\n" +
            "                    \"score\": 10,\n" +
            "                    \"risk_name\": \"身份证命中风险群体规则\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"suspect_team_detail_list\": [\n" +
            "                                {\n" +
            "                                    \"group_id\": \"92079941\",\n" +
            "                                    \"node_dist\": \"设备ID:18(64.29%);银行卡号:4(14.29%);手机号码:3(10.71%);身份证号:3(10.71%)\",\n" +
            "                                    \"fraud_dist\": \"法院结案:1(100%)\",\n" +
            "                                    \"black_rat\": \"3.57%\",\n" +
            "                                    \"grey_rat\": \"50%\",\n" +
            "                                    \"degree\": 5,\n" +
            "                                    \"black_cnt\": 1,\n" +
            "                                    \"grey_cnt\": 14,\n" +
            "                                    \"core_dst\": 1,\n" +
            "                                    \"black_dst\": 1,\n" +
            "                                    \"node_score\": 88,\n" +
            "                                    \"total_cnt_two\": 7,\n" +
            "                                    \"black_cnt_one\": 6,\n" +
            "                                    \"black_cnt_two\": 7,\n" +
            "                                    \"fraud_dist_one\": \"信贷逾期名单:1(100%)\",\n" +
            "                                    \"fraud_dist_two\": \"信贷逾期名单:2(100%)\"\n" +
            "                                }\n" +
            "                            ],\n" +
            "                            \"type\": \"suspected_team\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 1122546,\n" +
            "                    \"score\": 50,\n" +
            "                    \"risk_name\": \"各种类型规则集合\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"description\": \"身份证命中信贷逾期名单\",\n" +
            "                            \"discredit_times\": 6,\n" +
            "                            \"overdue_details\": [\n" +
            "                                {\n" +
            "                                    \"overdue_time\": \"2016-07\",\n" +
            "                                    \"overdue_amount_range\": \"(10000, 50000]\",\n" +
            "                                    \"overdue_day_range\": \"(60, 90]\",\n" +
            "                                    \"overdue_count\": 3\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"overdue_time\": \"2016-07\",\n" +
            "                                    \"overdue_amount_range\": \"(10000, 50000]\",\n" +
            "                                    \"overdue_day_range\": \"(60, 90]\",\n" +
            "                                    \"overdue_count\": 7\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"overdue_time\": \"2016-07\",\n" +
            "                                    \"overdue_amount_range\": \"(1000, 5000]\",\n" +
            "                                    \"overdue_day_range\": \"360+\",\n" +
            "                                    \"overdue_count\": 2\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"overdue_time\": \"2016-07\",\n" +
            "                                    \"overdue_amount_range\": \"(100000, 500000]\",\n" +
            "                                    \"overdue_day_range\": \"(270, 360]\",\n" +
            "                                    \"overdue_count\": 1\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"overdue_time\": \"2016-07\",\n" +
            "                                    \"overdue_amount_range\": \"(10000, 50000]\",\n" +
            "                                    \"overdue_day_range\": \"(180, 270]\",\n" +
            "                                    \"overdue_count\": 5\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"overdue_time\": \"2016-07\",\n" +
            "                                    \"overdue_day_range\": \"(60, 90]\",\n" +
            "                                    \"overdue_count\": 4\n" +
            "                                }\n" +
            "                            ],\n" +
            "                            \"type\": \"discredit_count\"\n" +
            "                        },\n" +
            "                        {\n" +
            "                            \"hit_type_display_name\": \"身份证号码\",\n" +
            "                            \"fraud_type_display_name\": \"\",\n" +
            "                            \"description\": \"身份证命中法院失信名单\",\n" +
            "                            \"court_details\": [],\n" +
            "                            \"type\": \"black_list\"\n" +
            "                        },\n" +
            "                        {\n" +
            "                            \"fuzzy_list_details\": [],\n" +
            "                            \"fraud_type_display_name\": \"\",\n" +
            "                            \"description\": \"身份证_姓名命中信贷逾期模糊名单\",\n" +
            "                            \"type\": \"fuzzy_black_list\"\n" +
            "                        },\n" +
            "                        {\n" +
            "                            \"description\": \"是否命中自定义名单\",\n" +
            "                            \"type\": \"custom_list\",\n" +
            "                            \"high_risk_areas\": [\n" +
            "                                \"12345\",\n" +
            "                                \"67890\"\n" +
            "                            ]\n" +
            "                        },\n" +
            "                        {\n" +
            "                            \"platform_detail_dimension\": [\n" +
            "                                {\n" +
            "                                    \"count\": 1,\n" +
            "                                    \"detail\": [\n" +
            "                                        {\n" +
            "                                            \"count\": 1,\n" +
            "                                            \"industry_display_name\": \"信用卡中心\"\n" +
            "                                        }\n" +
            "                                    ],\n" +
            "                                    \"dimension\": \"手机\"\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"count\": 7,\n" +
            "                                    \"detail\": [\n" +
            "                                        {\n" +
            "                                            \"count\": 5,\n" +
            "                                            \"industry_display_name\": \"无行业\"\n" +
            "                                        },\n" +
            "                                        {\n" +
            "                                            \"count\": 1,\n" +
            "                                            \"industry_display_name\": \"信用卡中心\"\n" +
            "                                        },\n" +
            "                                        {\n" +
            "                                            \"count\": 1,\n" +
            "                                            \"industry_display_name\": \"财产险\"\n" +
            "                                        }\n" +
            "                                    ],\n" +
            "                                    \"dimension\": \"身份证号码\"\n" +
            "                                }\n" +
            "                            ],\n" +
            "                            \"platform_detail\": [\n" +
            "                                {\n" +
            "                                    \"count\": 5,\n" +
            "                                    \"industry_display_name\": \"无行业\"\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"count\": 1,\n" +
            "                                    \"industry_display_name\": \"信用卡中心\"\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"count\": 1,\n" +
            "                                    \"industry_display_name\": \"财产险\"\n" +
            "                                }\n" +
            "                            ],\n" +
            "                            \"description\": \"在指定时间内，主属性匹配字段下关联的合作方的个数\",\n" +
            "                            \"type\": \"platform_detail\",\n" +
            "                            \"platform_count\": 7\n" +
            "                        },\n" +
            "                        {\n" +
            "                            \"hit_type_display_name\": \"身份证号码\",\n" +
            "                            \"fraud_type_display_name\": \"\",\n" +
            "                            \"grey_list_details\": [],\n" +
            "                            \"description\": \"身份证命中高风险关注名单\",\n" +
            "                            \"type\": \"grey_list\"\n" +
            "                        },\n" +
            "                        {\n" +
            "                            \"hit_type_display_name\": \"身份证号码\",\n" +
            "                            \"fraud_type_display_name\": \"\",\n" +
            "                            \"description\": \"身份证命中车辆租赁违约名单\",\n" +
            "                            \"type\": \"black_list\"\n" +
            "                        },\n" +
            "                        {\n" +
            "                            \"frequency_detail_list\": [\n" +
            "                                {\n" +
            "                                    \"data\": [],\n" +
            "                                    \"detail\": \"3个月身份证关联邮箱数：3\",\n" +
            "                                    \"dim_type\": \"idNumber\",\n" +
            "                                    \"sub_dim_type\": \"accountMobile\",\n" +
            "                                    \"note\": \"3个月身份证关联邮箱数\",\n" +
            "                                    \"count\": \"41\"\n" +
            "                                }\n" +
            "                            ],\n" +
            "                            \"type\": \"frequency_detail\"\n" +
            "                        },\n" +
            "                        {\n" +
            "                            \"cross_frequency_detail_list\": [\n" +
            "                                {\n" +
            "                                    \"detail\": \"3个月内申请人手机号作为第一联系人手机号出现的次数：45\",\n" +
            "                                    \"dim_type\": \"accountMobile\",\n" +
            "                                    \"sub_dim_type\": \"count\",\n" +
            "                                    \"note\": \"3个月内申请人手机号作为第一联系人手机号出现的次数\",\n" +
            "                                    \"count\": \"45\"\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"data\": [],\n" +
            "                                    \"detail\": \"借款人身份证在借款事件中的借款人身份证关联手机号个数：3\",\n" +
            "                                    \"dim_type\": \"idNumber\",\n" +
            "                                    \"sub_dim_type\": \"accountMobile\",\n" +
            "                                    \"note\": \"借款人身份证在借款事件中的借款人身份证关联手机号个数\",\n" +
            "                                    \"count\": \"3\"\n" +
            "                                }\n" +
            "                            ],\n" +
            "                            \"type\": \"cross_frequency_detail\"\n" +
            "                        },\n" +
            "                        {\n" +
            "                            \"cross_event_detail_list\": [\n" +
            "                                {\n" +
            "                                    \"detail\": \"主属性不变，统计过去时间片内指定字段值与当前字段值相同的次数：2\",\n" +
            "                                    \"dim_type\": \"idNumber\",\n" +
            "                                    \"sub_dim_type\": \"accountMobile\",\n" +
            "                                    \"note\": \"主属性不变，统计过去时间片内指定字段值与当前字段值相同的次数\",\n" +
            "                                    \"count\": \"2\"\n" +
            "                                }\n" +
            "                            ],\n" +
            "                            \"type\": \"cross_event_detail\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 924491,\n" +
            "                    \"score\": 91,\n" +
            "                    \"risk_name\": \"信贷名单\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"result\": \"1\",\n" +
            "                            \"hits\": [\n" +
            "                                {\n" +
            "                                    \"evidence_time\": \"2018-11\",\n" +
            "                                    \"overdue_amount\":\"500000+\",\n" +
            "                                    \"overdue_counts\":\"1\",\n" +
            "\t\t                            \"risk_type\": \"credit_crack\",\n" +
            "\t\t                            \"overdue_days\": \"360+\",\n" +
            "\t\t                            \"role\": \"self\",\n" +
            "\t\t                            \"subject_type\": \"individual\",\n" +
            "                                    \"industry\": \"L2_p2p\"\n" +
            "                                }\n" +
            "                            ],\n" +
            "                            \"type\": \"creditList_index_detail\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 924681,\n" +
            "                    \"score\": 1,\n" +
            "                    \"risk_name\": \"设备状态异常\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"abnormal_tags\": [\n" +
            "                                \"ABNORMAL_TIME\"\n" +
            "                            ],\n" +
            "                            \"type\": \"device_status_abnormal\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 924691,\n" +
            "                    \"score\": 1,\n" +
            "                    \"risk_name\": \"设备获取异常\",\n" +
            "                    \"policy_decision\": \"Reject\",\n" +
            "                    \"policy_mode\": \"Weighted\",\n" +
            "                    \"policy_score\": 611,\n" +
            "                    \"policy_name\": \"借款策略\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"code\": \"072\",\n" +
            "                            \"code_display_name\": \"参数校验非法\",\n" +
            "                            \"type\": \"fp_exception\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                                                {\n" +
            "                    \"rule_id\": 924711,\n" +
            "                    \"score\": 91,\n" +
            "                    \"risk_name\": \"函数工具箱\",\n" +
            "                    \"policy_decision\": \"Reject\",\n" +
            "                    \"policy_mode\": \"Weighted\",\n" +
            "                    \"policy_score\": 611,\n" +
            "                    \"policy_name\": \"借款策略\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"result\": 2.0,\n" +
            "                            \"type\": \"function_kit\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 9247142,\n" +
            "                    \"score\": 96,\n" +
            "                    \"risk_name\": \"函数工具箱\",\n" +
            "                    \"policy_decision\": \"Reject\",\n" +
            "                    \"policy_mode\": \"Weighted\",\n" +
            "                    \"policy_score\": 611,\n" +
            "                    \"policy_name\": \"借款策略\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"result\": 2.0,\n" +
            "                            \"type\": \"four_calculate\"\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 9247142,\n" +
            "                    \"score\": 96,\n" +
            "                    \"risk_name\": \"关联风险分规则\",\n" +
            "                    \"policy_decision\": \"Reject\",\n" +
            "                    \"policy_mode\": \"Weighted\",\n" +
            "                    \"policy_score\": 611,\n" +
            "                    \"policy_name\": \"手机风险\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"node_score\": 100,\n" +
            "                            \"dim_type\": \"accountMobile\",\n" +
            "                            \"dim_value\": \"13011253684\",\n" +
            "                            \"type\": \"assoc_risk_score\",\n" +
            "                            \"assoc_risk_score_detail_list\": [\n" +
            "                                {\n" +
            "                                    \"total_cnt_two\": 2,\n" +
            "                                    \"node_dist\": \"银行卡:31(31.31%);设备ID:27(27.27%);身份证:12(12.12%);一般联系人手机:11(11.11%);手机:10(10.1%);联系人身份证:8(8.08%)\",\n" +
            "                                    \"black_cnt_one\": 1,\n" +
            "                                    \"node_score\": 89,\n" +
            "                                    \"dim_value\": \"13333333333\",\n" +
            "                                    \"fraud_dist\": \"商户欺诈:13(28.26%);刑事犯罪:7(15.22%);盗用账户:6(13.04%);法院结案:6(13.04%);法院失信:5(10.87%);信贷逾期名单:5(10.87%);法院执行:4(8.7%)\",\n" +
            "                                    \"core_node\": true,\n" +
            "                                    \"dim_type\": \"accountMobile\",\n" +
            "                                    \"group_id\": \"22842\",\n" +
            "                                    \"degree\": 1,\n" +
            "                                    \"fraud_dist_two\": \"\",\n" +
            "                                    \"core_dst\": 0,\n" +
            "                                    \"total_cnt\": 99,\n" +
            "                                    \"fraud_dist_one\": \"商户欺诈:1(100%)\",\n" +
            "                                    \"black_cnt\": 46,\n" +
            "                                    \"grey_rat\": \"49.49%\",\n" +
            "                                    \"black_rat\": \"46.46%\",\n" +
            "                                    \"black_dst\": 0,\n" +
            "                                    \"grey_cnt\": 49,\n" +
            "                                    \"link_associations_key\": \"b978c612abc9a83a60d71ddffce6949f6e6ca922708b18fb4d6dd8f96759b25f\",\n" +
            "                                    \"black_cnt_two\": 0\n" +
            "                                },{\n" +
            "                                    \"total_cnt_two\": 19,\n" +
            "                                    \"node_dist\": \"银行卡:31(31.31%);设备ID:27(27.27%);身份证:12(12.12%);一般联系人手机:11(11.11%);手机:10(10.1%);联系人身份证:8(8.08%)\",\n" +
            "                                    \"black_cnt_one\": 2,\n" +
            "                                    \"node_score\": 59,\n" +
            "                                    \"dim_value\": \"111139198402151111\",\n" +
            "                                    \"fraud_dist\": \"商户欺诈:13(28.26%);刑事犯罪:7(15.22%);盗用账户:6(13.04%);法院结案:6(13.04%);法院失信:5(10.87%);信贷逾期名单:5(10.87%);法院执行:4(8.7%)\",\n" +
            "                                    \"core_node\": true,\n" +
            "                                    \"dim_type\": \"idNumber\",\n" +
            "                                    \"group_id\": \"22842\",\n" +
            "                                    \"degree\": 2,\n" +
            "                                    \"fraud_dist_two\": \"商户欺诈:3(33.33%);信贷逾期名单:2(22.22%);法院结案:2(22.22%);刑事犯罪:2(22.22%)\",\n" +
            "                                    \"core_dst\": 0,\n" +
            "                                    \"total_cnt\": 99,\n" +
            "                                    \"fraud_dist_one\": \"刑事犯罪:1(50%);法院执行:1(50%)\",\n" +
            "                                    \"black_cnt\": 46,\n" +
            "                                    \"grey_rat\": \"49.49%\",\n" +
            "                                    \"black_rat\": \"46.46%\",\n" +
            "                                    \"black_dst\": 0,\n" +
            "                                    \"grey_cnt\": 49,\n" +
            "                                    \"link_associations_key\": \"25feb7df51dc97c551a48a1ffa0fcbfd7f6bbf991bf58c8b9623a812787b78436747715035394e51\",\n" +
            "                                    \"black_cnt_two\": 9\n" +
            "                                }\n" +
            "                            ]\n" +
            "                        }\n" +
            "                    ]\n" +
            "                },\n" +
            "                {\n" +
            "                    \"rule_id\": 714629,\n" +
            "                    \"score\": 10,\n" +
            "                    \"risk_name\": \"自定义规则\",\n" +
            "                    \"policy_decision\": \"Reject\",\n" +
            "                    \"policy_mode\": \"Weighted\",\n" +
            "                    \"policy_score\": 611,\n" +
            "                    \"policy_name\": \"借款策略\",\n" +
            "                    \"risk_detail\": [\n" +
            "                        {\n" +
            "                            \"type\": \"indicatrix_result\",\n" +
            "                            \"indicatrix_result_detail_list\": [\n" +
            "                                {\n" +
            "                                    \"result\": 0,\n" +
            "                                    \"description\": \"身份证关联到的90天内全行业下全事件中的合作方最大银行卡数\"\n" +
            "                                },\n" +
            "                                {\n" +
            "                                    \"result\": 3,\n" +
            "                                    \"description\": \"身份证关联到的365天内全行业下申贷事件中的合作方最大银行卡数\"\n" +
            "                                }\n" +
            "                            ]\n" +
            "                        }\n" +
            "                    ]\n" +
            "                }\n" +
            "            ],\n" +
            "            \"final_decision\": \"REJECT\"\n" +
            "        }\n" +
            "    }\n" +
            "}";

    private static void print(){
     String[] split = str.split("\n");
     StringBuilder sb = new StringBuilder();
     for (String split1 : split) {
      String[] s = split1.split("\t");
      //小驼峰
      s[0] = s[0].trim();
      s[s.length-1] = s[s.length-1].trim();
      s[0] = StrUtil.toCamelCase(s[0]);
      if(s[2].equals("JSONArray")){
       s[2] = s[0];
       s[2] = s[2].substring(0,1).toUpperCase()+s[2].substring(1);
         s[2] = StrUtil.format("List<{}>",s[2]);
      }
      if(s[2].equals("JSONObject")){
       s[2] = s[0];
       s[2] = s[2].substring(0,1).toUpperCase()+s[2].substring(1);
      }
      String format = StrUtil.format(template1, StrUtil.isEmpty(s[1])?s[4]:s[1], "", s[s.length-1], s[2], s[0]);
      sb.append(format);
     }
     System.out.println(sb.toString());
    }
}
